package cn.monkey.family.server.domain.sys.file;

import cn.monkey.family.bean.container.spring.AbstractSpringBeanContainer;

import java.util.Collections;
import java.util.function.Function;
import java.util.stream.Collectors;

public class DefaultFileHandlerContainer extends AbstractSpringBeanContainer<IFileHandler> implements FileHandlerContainer {

    @Override
    public void afterPropertiesSet() throws Exception {
        super.afterPropertiesSet();
        super.beanMap = Collections.unmodifiableMap(this.getAll()
                .stream()
                .collect(Collectors.toMap(IFileHandler::getName, Function.identity())));
    }
}
